home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC] / NeXTSTEP 3.3 Dev Intel.iso / NextDeveloper / Source / GNU / libg++ / libio / stdio / setfileno.c < prev    next >
C/C++ Source or Header  |  1994-02-15  |  418b  |  18 lines

  1. /* Some known programs (xterm, pdksh?) non-portably change the _file
  2.    field of s struct _iobuf.  This kludge allows the same "functionality".
  3.    This code is an undocumented feature for iostream/stdio. Use it at
  4.    your own risk. */
  5.  
  6. #include "libioP.h"
  7. #include "stdio.h"
  8.  
  9. void
  10. setfileno(fp, fd)
  11.      _IO_FILE* fp;
  12.      int fd;
  13. {
  14.   COERCE_FILE(fp);
  15.   if ((fp->_flags & _IO_IS_FILEBUF) != 0)
  16.     fp->_fileno = fd;
  17. }
  18.